(function(){

	window.alertSuccess = {};
	window.alertError = {};
	window.appendStr = {};
	function success(str){
		$('.data-alert').animate({top:"0px",display:'block'},1);
		$('.date-success-alert').html(str).show().animate({top:"50px"},500);
		var timer = setTimeout(function(){
			$('.date-success-alert').animate({top:"-100px",display:'none'},800);
			$('.data-alert').animate({top:"-100px",display:'none'},1000);
			clearTimeout(timer);
		},3000);

	}

	function error(str){
		$('.data-alert').animate({top:"0px",display:'block'},1);
		$('.date-error-alert').html(str).show().animate({top:"50px"},500);
		var timer = setTimeout(function(){
			$('.date-error-alert').animate({top:"-100px",display:'none'},1000);
			$('.data-alert').animate({top:"-100px",display:'none'},1000);
			clearTimeout(timer);
		},3000);
	}

	function appendStr(){
		str = '<div class="" style="position: fixed;top:0px;left:0px;padding:0px;width:100%;height:0px;z-index: 999999;">' +
			'<div class="data-alert" style="margin: 0 auto;width: 50%;min-width: 200px;padding: 0px ;position: relative;">' +
			'<div class="date-success-alert" style="padding: 0px 50px;display:none;box-shadow: 5px 5px 5px rgb(221, 221, 221);font-size: 16px;background: #fff;text-align: center;height: 38px;line-height: 38px;position: relative;top: -100px;border-radius: 5px; color: #fff;background: rgba(0,192,254,0.8);">操作成功' +
			'</div>' +
			'<div class="date-error-alert" style="padding: 0px 50px;display:none;background:box-shadow: 5px 5px 5px rgb(221, 221, 221); font-size: 16px;#fff;text-align: center;height: 38px;line-height: 38px;position: relative;top: -150px;border-radius: 5px; color: yellow;background: rgba(255,0,0,0.8);">操作失败</div>' +
			'</div> </div>';
		$('body').append(str);
	}

	window.alertSuccess = success;
	window.alertError = error;
	window.appendStr = appendStr;

	window.appendStr();

})();